#makefile
CC = gcc
CFLAGS := -g -Wall -O0
INCLUDE :=$(shell pkg-config --cflags --libs glib-2.0)
LIB := -lpthread -L /usr/lib64/ -lz 
SRC := $(shell pwd)
BIN := webserver
INCLUDE += -I $(SRC)/event/ -I $(SRC)/ -I /usr/include/ -I $(SRC)/plugin/
LOG := $(SRC)/log.o
IO := $(SRC)/io.o
UTILS := $(SRC)/utils.o
GZIP := $(SRC)/plugin/gzip.o 
CHUNK := $(SRC)/plugin/chunk.o 
WEBSERVER := $(SRC)/webserver.o
EPOLLMODULE := $(SRC)/event/epollModule.o
CONFIGPARSE := $(SRC)/configParse.o
CONNPOOL := $(SRC)/connpool.o
HTTPPARSE := $(SRC)/httpParse.o
MAIN := $(SRC)/main.o
CFLAGS += $(INCLUDE)
MAIN += $(WEBSERVER) $(UTILS) $(LOG) $(IO) $(CONFIGPARSE) $(EPOLLMODULE) $(CONNPOOL) $(HTTPPARSE) $(GZIP)

all:$(MAIN)
	$(CC) $(CFLAGS) -o $(BIN) $(MAIN) $(LIB)
clean:
	rm -rf *.o
	rm -rf ./event/*.o
	rm -rf $(BIN)
	rm -rf ./log/*.log 
	rm -rf ./plugin/*.o	
